﻿namespace demo04整数类型
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello, World!");
            //数据类型 变量名
            //byte类型
            //byte b = 256;  
            //类型.MaxValue 可以获取能存储的最大值
            byte b1 = byte.MinValue; 
            byte b2 = byte.MaxValue;
            Console.WriteLine(b1);  //0
            Console.WriteLine(b2);  //255

            //int类型
            int i = 666;
            int i1 = int.MinValue;
            int i2 = int.MaxValue;
            Console.WriteLine("int类型");
            Console.WriteLine(i);
            Console.WriteLine(i1);
            Console.WriteLine(i2);

            //short类型
            short s = -32768;
            short s1 = short.MinValue;
            short s2 = short.MaxValue;
            Console.WriteLine("short类型");
            Console.WriteLine(s);
            Console.WriteLine(s1);
            Console.WriteLine(s2);

            //long类型
            long l = 23;
            long l1 = long.MaxValue;
            long l2 = long.MinValue;
            Console.WriteLine("long类型");
            Console.WriteLine(l);
            Console.WriteLine(l1);
            Console.WriteLine(l2);

            //变量可以重新赋值
            int x = 10;
            byte y = 11;
            short c = 12;
            long d = 15;

            x = y;  //byte类型赋值给int类型
            //y = c;
            //short类型不能赋值给byte
            //大的存储范围可以存储小的范围
            //小的存储范围无法存储大的范围
        }
    }
}
